<ion-header>
	<ion-navbar>
		<ion-title>登录</ion-title>
	</ion-navbar>
</ion-header>

<ion-content>
	<div class="logo">
		<img src="assets/img/appicon.svg" alt="Ionic logo">
	</div>

	<form #loginForm="ngForm" novalidate>
		<ion-list no-lines>
			<ion-item>
				<ion-label fixed text-center color="primary">帐号</ion-label>
				<ion-input [(ngModel)]="postBody.UserId" name="username" type="text" #username="ngModel" spellcheck="false" autocapitalize="off"
				 required>
				</ion-input>
			</ion-item>
			<ion-item>
				<ion-label fixed text-center color="primary">密码</ion-label>
				<ion-input [(ngModel)]="postBody.PassWord" name="password" type="password" #password="ngModel" required>
				</ion-input>
			</ion-item>
			<ion-item>
				<ion-label>学生</ion-label>
				<ion-checkbox [checked]="select" (click)="setRole('student')"></ion-checkbox>
			</ion-item>
			<ion-item>
				<ion-label>教师</ion-label>
				<ion-checkbox [checked]="!select" (click)="setRole('teacher')"></ion-checkbox>
			</ion-item>
		</ion-list>

		<ion-row responsive-sm>
			<ion-col>
				<button ion-button (click)="login()" [disabled]="!loginForm.form.valid" block>登录</button>
			</ion-col>
		</ion-row>
	</form>

</ion-content>